home *** CD-ROM | disk | FTP | other *** search
Text File | 2003-07-17 | 40.2 KB | 1,455 lines |
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- // Copyright (C) 1997-2001 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
-
- // For mac, we need add an extra layout, i.e Menubar layout. That is the reason
- // for introducing `about -mac` code at many places
-
- global proc shelfEdRepeatableFlagChanged() {
- global string $gShelfTopLevel;
-
- string $shelfList, $itemList, $cbg1;
- if(`about -mac`){
- $shelfList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tsl2";
- $cbg1 = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|cbg1";
- }else{
- $shelfList = "shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|fl|topTab|fl3|tsl2";
- $cbg1 = "shelfEditorWin|fl|topTab|fl3|cbg1";
- }
- string $item;
- string $itemStr;
- string $retVal[];
- string $selected[];
- string $type;
- int $index;
- int $itemIndex[];
- int $i, $nArr;
- int $newVal = false;
-
- $retVal = `textScrollList -q -si $itemList`;
- if (size($retVal) > 0) {
- $itemStr = $retVal[0];
- // get new value of the flag
- //
- $newVal = `checkBoxGrp -query -value1 $cbg1`;
-
- // get real item name
- //
- $itemIndex = `textScrollList -q -sii $itemList`;
- $index = $itemIndex[0] - 1;
- $selected = `textScrollList -q -si $shelfList`;
- $retVal = `shelfLayout -q -ca $selected[0]`;
- $item = ($gShelfTopLevel + "|" + $selected[0] + "|" + $retVal[$index]);
- $type = `objectType $item`;
-
- switch ($type) {
- case "toolButton":
- //toolButton -e -iol $newName $item;
- break;
- case "shelfButton":
- //shelfButton -e -iol $newName $item;
- shelfButton -e -ecr $newVal $item;
- break;
- }
- }
- }
-
-
- global proc shelfEditorDialog ()
- {
- global string $gShelfTopLevel;
- global int $gShelfCreated;
-
- string $shelfList, $itemList, $tfg;
- string $retVal[], $form;
- int $col1width = 180;
-
- // Check if the Shelf has been created yet. If not, then build it so
- // the Shelf Editor actually has something to work with.
- //
- if (!$gShelfCreated) {
- buildShelves();
- $gShelfCreated = true;
- }
-
- if (!`window -exists shelfEditorWin`) {
-
- window -t "Shelves" -iconName "Shelves"
- -menuBar true
- shelfEditorWin;
-
- // Add an options menu for shelf preferences
- //
- menu -label "Options";
-
- //
- // Icon style
- //
- radioMenuItemCollection;
- menuItem -l "Icon Only"
- -rb off
- -c "setShelfStyle \"iconOnly\" \"Small\"; optionVar -sv shelfItemStyle \"iconOnly\""
- iconOnlyItem;
- menuItem -l "Icon/Text Below"
- -rb off
- -c "setShelfStyle \"iconAndTextVertical\" \"Small\"; optionVar -sv shelfItemStyle \"iconAndTextVertical\""
- iconTextBelowItem;
- menuItem -l "Icon/Text Beside"
- -rb off
- -c "setShelfStyle \"iconAndTextHorizontal\" \"Small\"; optionVar -sv shelfItemStyle \"iconAndTextHorizontal\""
- iconTextBesideItem;
-
- // set the initial value
- string $shelfItemLayout = `optionVar -q shelfItemStyle`;
- if ("textOnly" == $shelfItemLayout) {
- // Don't support anymore so go for icon only
- menuItem -e -rb on iconOnlyItem;
- } else if ("iconAndTextVertical" == $shelfItemLayout) {
- menuItem -e -rb on iconTextBelowItem;
- } else if ("iconAndTextHorizontal" == $shelfItemLayout) {
- menuItem -e -rb on iconTextBesideItem;
- } else {
- // default to icon only
- menuItem -e -rb on iconOnlyItem;
- }
-
- //
- // shelf saving
- //
- menuItem -divider true;
- radioMenuItemCollection;
- menuItem -l "Save Automatically"
- -rb off
- -c "optionVar -iv isShelfSave 1"
- autoSaveItem;
- menuItem -l "Save Only on Request"
- -rb off
- -c "optionVar -iv isShelfSave 0"
- requestSaveItem;
-
- // Set the initial value
- if (`optionVar -q isShelfSave`) {
- menuItem -e -rb on autoSaveItem;
- } else {
- menuItem -e -rb on requestSaveItem;
- }
-
- menu -label "Help" -helpMenu true;
- menuItem -label "Help on Shelves..."
- -enableCommandRepeat false
- -command "showHelp ShelfEditor";
-
- setParent -m ..;
-
- formLayout fl;
- tabLayout -preSelectCommand "shelfEdTabPreSelect" topTab;
- $form = `formLayout fl2`;
-
- $shelfList = `textScrollList -nr 9
- -w $col1width
- -allowMultiSelection false
- -selectCommand "shelfEdShelfChanged" tsl`;
-
- string $buttonForm = `formLayout sForm`;
-
- button -l "Move Up"
- -c "shelfEdMoveShelf 1" moveUpBtn;
-
- button -l "Move Down"
- -c "shelfEdMoveShelf 0" moveDownBtn;
-
- button -l "New Shelf"
- -c "shelfEdNewShelf" newShelfBtn;
-
- button -l "Delete Shelf"
- -c "shelfEdDeleteShelf" deleteShelfBtn;
-
- setParent ..;
-
- formLayout -e
- -af moveUpBtn top 7
- -ap moveUpBtn left 0 2
- -ap moveUpBtn right 0 24
- -an moveUpBtn bottom
-
- -af moveDownBtn top 7
- -ap moveDownBtn left 0 25
- -ap moveDownBtn right 0 49
- -an moveDownBtn bottom
-
- -af newShelfBtn top 7
- -ap newShelfBtn left 0 50
- -ap newShelfBtn right 0 74
- -an newShelfBtn bottom
-
- -af deleteShelfBtn top 7
- -ap deleteShelfBtn left 0 75
- -ap deleteShelfBtn right 0 98
- -an deleteShelfBtn bottom
- $buttonForm;
-
- $tfg = `textFieldGrp -l "Name:"
- -w $col1width
- -cw 1 120
- -cat 1 "right" 5
- -cat 2 "both" 0
- -cc "shelfEdNameChanged"
- tfg`;
-
- formLayout -edit
- -attachForm $shelfList "top" 5
- -attachForm $shelfList "left" 5
- -attachControl $shelfList "bottom" 0 $buttonForm
- -attachForm $shelfList "right" 5
-
- -attachNone $buttonForm "top"
- -attachForm $buttonForm "left" 0
- -attachControl $buttonForm "bottom" 7 $tfg
- -attachForm $buttonForm "right" 0
-
- -attachNone $tfg "top"
- -attachForm $tfg "left" 0
- -attachForm $tfg "bottom" 5
- -attachForm $tfg "right" 0
- $form;
- if(`about -mac`){
- setParent shelfEditorWin|shelfEditorWin|fl|topTab;
- }else{
- setParent shelfEditorWin|fl|topTab;
- }
- $form = `formLayout fl3`;
- if(`about -mac`){
- tabLayout -e -sti 2 shelfEditorWin|shelfEditorWin|fl|topTab;
- }else{
- tabLayout -e -sti 2 shelfEditorWin|fl|topTab;
- }
-
- textScrollList -nr 6
- -allowMultiSelection false
- -selectCommand "shelfEdItemChanged"
- tsl2;
-
- button -l "Move Up"
- -c "shelfEdMoveItem 1" scMoveUp;
-
- button -l "Move Down"
- -c "shelfEdMoveItem 0" scMoveDown;
-
- button -l "Delete Item"
- -c "shelfEdDeleteItem"
- rmBtn;
-
- $tfg = `textFieldGrp -l "Label & Tooltips:"
- -cw 1 120
- -cat 1 "right" 5
- -cat 2 "both" 0
- -cc "shelfEdItemNameChanged"
- tfg2`;
-
- textFieldGrp -l "Icon Name:"
- -cw 1 120
- -cat 1 "right" 5
- -cat 2 "both" 0
- -cc "shelfEdOverlayNameChanged"
- tfg3;
- checkBoxGrp -label ""
- -label1 "Repeatable"
- -cw 1 120
- -onc "shelfEdRepeatableFlagChanged"
- -ofc "shelfEdRepeatableFlagChanged"
- cbg1;
-
- string $separator = `separator
- -horizontal false -height 40 -style "none"`;
-
- picture -image "sphere.xpm" pictCntl;
-
- button -l "Change Image..."
- -c "shelfEdModifyIcon"
- modBtn;
-
- setParent ..;
-
- formLayout -e
- -attachForm tsl2 top 5
- -attachForm tsl2 right 5
- -attachForm tsl2 left 5
- -attachControl tsl2 bottom 5 scMoveUp
-
- -attachNone scMoveUp top
- -attachPosition scMoveUp left 0 2
- -attachControl scMoveUp bottom 5 tfg2
- -attachPosition scMoveUp right 0 32
-
- -attachNone scMoveDown top
- -attachPosition scMoveDown left 0 34
- -attachControl scMoveDown bottom 5 tfg2
- -attachPosition scMoveDown right 0 65
-
- -attachNone rmBtn top
- -attachPosition rmBtn left 0 67
- -attachControl rmBtn bottom 5 tfg2
- -attachPosition rmBtn right 0 98
-
- -attachNone tfg2 top
- -attachForm tfg2 left 0
- -attachControl tfg2 bottom 5 tfg3
- -attachForm tfg2 right 0
-
- -attachNone tfg3 top
- -attachForm tfg3 left 0
- -attachControl tfg3 bottom 5 cbg1
- -attachForm tfg3 right 0
-
- -attachNone cbg1 top
- -attachForm cbg1 left 0
- -attachControl cbg1 bottom 5 $separator
- -attachForm cbg1 right 0
-
- -attachNone $separator top
- -attachForm $separator left 120
- -attachForm $separator bottom 5
- -attachNone $separator right
-
- -aoc pictCntl top 0 $separator
- -attachNone pictCntl left
- -attachNone pictCntl bottom
- -attachControl pictCntl right 0 $separator
-
- -aoc modBtn top 0 $separator
- -attachControl modBtn left 0 $separator
- -attachNone modBtn bottom
- -attachNone modBtn right
-
- $form;
-
- if(`about -mac`){
- setParent shelfEditorWin|shelfEditorWin|fl|topTab;
- }else{
- setParent shelfEditorWin|fl|topTab;
- }
- frameLayout -bv false -lv false -cll false -mw 15 -mh 10 fl4;
- formLayout frm;
-
- text -l "Edit shelf button command:" scrFldTxt;
-
- scrollField -h 80 -w 200
- -enable false
- -ec "shelfEdCmdStringChanged"
- scrFld;
-
- if(`about -mac`){
- formLayout -e
- -af scrFldTxt "top" 0
- -af scrFldTxt "left" 0
- -af scrFld "left" 0
- -ac scrFld "top" 5 scrFldTxt
- -af scrFld "bottom" 0
- -af scrFld "right" 0
- shelfEditorWin|shelfEditorWin|fl|topTab|fl4|frm;
- }else{
- formLayout -e
- -af scrFldTxt "top" 0
- -af scrFldTxt "left" 0
- -af scrFld "left" 0
- -ac scrFld "top" 5 scrFldTxt
- -af scrFld "bottom" 0
- -af scrFld "right" 0
- shelfEditorWin|fl|topTab|fl4|frm;
- }
-
- if(`about -mac`){
- tabLayout -e
- -tli 1 "Shelves"
- -tli 2 "Shelf Contents"
- -tli 3 "Edit Commands"
- shelfEditorWin|shelfEditorWin|fl|topTab;
- }else{
- tabLayout -e
- -tli 1 "Shelves"
- -tli 2 "Shelf Contents"
- -tli 3 "Edit Commands"
- shelfEditorWin|fl|topTab;
- }
-
- // Add the standard 'close' button to the bottom
- // along with a button to save the shelves
-
- if(`about -mac`){
- setParent shelfEditorWin|shelfEditorWin|fl;
- }else{
- setParent shelfEditorWin|fl;
- }
- separator -horizontal true shelfSeparator;
-
- button -l "Save All Shelves"
- -c "shelfEdSaveAllShelves"
- saveShelvesButton;
- button -l "Close"
- -c "shelfEdCloseWindow"
- closeShelfEdButton;
-
- formLayout -e
- -af topTab "top" 0
- -af topTab "left" 0
- -af topTab "right" 0
- -ac topTab "bottom" 5 shelfSeparator
-
- -af shelfSeparator "left" 0
- -af shelfSeparator "right" 0
- -ac shelfSeparator "bottom" 5 closeShelfEdButton
-
- -af saveShelvesButton "left" 5
- -af saveShelvesButton "bottom" 5
- -ap saveShelvesButton "right" 3 50
- -an saveShelvesButton "top"
-
- -ap closeShelfEdButton "left" 2 50
- -af closeShelfEdButton "bottom" 5
- -af closeShelfEdButton "right" 5
- -an closeShelfEdButton "top"
- fl;
-
- } else {
- if(`about -mac`){
- $shelfList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tsl";
- $tfg = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tfg";
- }else{
- $shelfList = "shelfEditorWin|fl|topTab|fl2|tsl";
- $tfg = "shelfEditorWin|fl|topTab|fl2|tfg";
- }
- }
-
- updateShelfEdView;
- if (`textScrollList -q -numberOfItems $shelfList` > 0) {
- textScrollList -e -si `tabLayout -q -st $gShelfTopLevel` $shelfList;
- shelfEdShelfChanged;
- }
- showWindow shelfEditorWin;
- }
-
-
- global proc updateShelfEdView()
- //
- // Description:
- // Updates the shelf list.
- //
- {
-
- string $shelfList;
- if(`about -mac`){
- $shelfList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tsl";
- }else{
- $shelfList = "shelfEditorWin|fl|topTab|fl2|tsl";
- }
- int $i, $j;
- int $nShelves = `optionVar -q numShelves`;
-
- textScrollList -e -removeAll $shelfList;
-
- for ($i = 1; $i <= $nShelves; $i++) {
- textScrollList -e -a `optionVar -q ("shelfName" + $i)` $shelfList;
- }
- }
-
- global proc shelfEdShelfChanged()
- //
- // Description:
- // Updates the dialog based on a change in the selected shelf.
- //
- {
-
- global string $gShelfTopLevel;
-
- string $shelfList;
- string $tfg;
- // string $cbg;
- string $itemList;
- string $tfg2;
- if(`about -mac`){
- $shelfList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tsl";
- $tfg = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tfg";
- // $cbg = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|cbg";
- $itemList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tsl2";
- $tfg2 = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tfg2";
- }else{
- $shelfList = "shelfEditorWin|fl|topTab|fl2|tsl";
- $tfg = "shelfEditorWin|fl|topTab|fl2|tfg";
- // $cbg = "shelfEditorWin|fl|topTab|fl2|cbg";
- $itemList = "shelfEditorWin|fl|topTab|fl3|tsl2";
- $tfg2 = "shelfEditorWin|fl|topTab|fl3|tfg2";
- }
- string $retVal[];
- string $name;
- string $type;
- int $i, $nArr;
-
- // update shelf text field
- //
- $retVal = `textScrollList -q -si $shelfList`;
- textFieldGrp -e -tx $retVal[0] $tfg;
-
- // select tab in shelf
- //
- if (`tabLayout -exists $gShelfTopLevel`) {
- tabLayout -e -selectTab $retVal[0] $gShelfTopLevel;
- }
-
- // update shelf contents text scroll list
- //
- textScrollList -e -removeAll $itemList;
- $retVal = `shelfLayout -q -ca $retVal[0]`;
- $nArr = size($retVal);
- for ($i = 0; $i < $nArr; $i++) {
- $type = `objectType $retVal[$i]`;
- switch ($type) {
- case "toolButton":
- $name = `toolButton -q -tool $retVal[$i]`;
- break;
- case "shelfButton":
- $name = `shelfButton -q -label $retVal[$i]`;
- if ($name == "") {
- $name = " ";
- }
- break;
- }
- textScrollList -e -a $name $itemList;
- }
-
- if ($nArr > 0) {
- textScrollList -e -sii 1 $itemList;
- }
-
- shelfEdItemChanged;
-
- }
-
- global proc shelfEdNameChanged() {
-
- global string $gShelfTopLevel;
- string $shelfList;
- string $tfg;
- if(`about -mac`){
- $shelfList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tsl";
- $tfg = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tfg";
- }else{
- $shelfList = "shelfEditorWin|fl|topTab|fl2|tsl";
- $tfg = "shelfEditorWin|fl|topTab|fl2|tfg";
- }
- string $newName;
- string $oldName;
- string $fileName;
- string $shelfName;
- string $oldFileName;
- int $i,$j;
- int $selected[];
- string $listItems[];
- int $isOkay = true;
-
- // update controls
- //
- $listItems = `textScrollList -q -si $shelfList`;
- $oldName = $listItems[0];
- $newName = `textFieldGrp -q -tx $tfg`;
- $selected = `textScrollList -q -sii $shelfList`;
-
- // test to make sure the new name is okay
- //
- if (validateShelfName($newName)) {
- //
- // Everything looks okay to change the name
- //
- textScrollList -e -deselectAll $shelfList;
- textScrollList -e -rii $selected[0] $shelfList;
- textScrollList -e -ap $selected[0] $newName -sii $selected[0] $shelfList;
-
- // update prefs
- //
- optionVar -sv ("shelfName" + $selected[0]) $newName;
- optionVar -sv ("shelfFile" + $selected[0]) ("shelf_" + $newName);
-
- // rename shelfLayout
- //
- setParent $gShelfTopLevel;
- renameUI $oldName $newName;
-
- // rename the tab
- //
- tabLayout -e -tl $newName $newName $gShelfTopLevel;
-
- // rename file
- //
- $oldFileName = (`internalVar -userShelfDir` + "shelf_" + $oldName + ".mel");
- if (`file -q -exists $oldFileName`) {
- saveShelf $newName (`internalVar -userShelfDir` + "shelf_" + $newName);
- sysFile -delete $oldFileName;
- }
- } else {
- // Put the old name back
- textFieldGrp -e -tx $oldName $tfg;
- }
- }
-
- global proc shelfEdItemChanged() {
-
- global string $gShelfTopLevel;
-
- string $shelfList;
- string $itemList;
- string $tfg2;
- string $tfg3;
- string $cbg;
- string $pictCntl;
- string $modBtn;
- string $upBtn;
- string $downBtn;
- string $delBtn;
- string $scrFld;
- string $statTxt;
- if(`about -mac`){
- $shelfList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tsl2";
- $tfg2 = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tfg2";
- $tfg3 = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tfg3";
- $cbg = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|cbg1";
- $pictCntl = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|pictCntl";
- $modBtn = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|modBtn";
- $upBtn = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|scMoveUp";
- $downBtn = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|scMoveDown";
- $delBtn = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|rmBtn";
- $scrFld = "shelfEditorWin|shelfEditorWin|fl|topTab|fl4|frm|scrFld";
- $statTxt = "shelfEditorWin|shelfEditorWin|fl|topTab|fl4|frm|scrFldTxt";
- }else{
- $shelfList = "shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|fl|topTab|fl3|tsl2";
- $tfg2 = "shelfEditorWin|fl|topTab|fl3|tfg2";
- $tfg3 = "shelfEditorWin|fl|topTab|fl3|tfg3";
- $cbg = "shelfEditorWin|fl|topTab|fl3|cbg1";
- $pictCntl = "shelfEditorWin|fl|topTab|fl3|pictCntl";
- $modBtn = "shelfEditorWin|fl|topTab|fl3|modBtn";
- $upBtn = "shelfEditorWin|fl|topTab|fl3|scMoveUp";
- $downBtn = "shelfEditorWin|fl|topTab|fl3|scMoveDown";
- $delBtn = "shelfEditorWin|fl|topTab|fl3|rmBtn";
- $scrFld = "shelfEditorWin|fl|topTab|fl4|frm|scrFld";
- $statTxt = "shelfEditorWin|fl|topTab|fl4|frm|scrFldTxt";
- }
- string $item;
- string $image;
- string $overlayLabel;
- string $selected[];
- string $retVal[];
- string $type;
- string $cmdStr;
- int $itemIndex[];
- int $index;
- int $i, $nArr;
- int $repeatFlag = false;
- // update item text field
- //
- $retVal = `textScrollList -q -si $itemList`;
- if (size($retVal) > 0) {
- textFieldGrp -e -tx $retVal[0] $tfg2;
-
- // get real item name
- //
- $itemIndex = `textScrollList -q -sii $itemList`;
- $index = $itemIndex[0] - 1;
- $selected = `textScrollList -q -si $shelfList`;
- $retVal = `shelfLayout -q -ca $selected[0]`;
- $item = ($gShelfTopLevel + "|" + $selected[0] + "|" + $retVal[$index]);
- $type = `objectType $item`;
-
- switch ($type) {
- case "toolButton":
- $overlayLabel = `toolButton -q -iol $item`;
- textFieldGrp -e -tx $overlayLabel $tfg3;
- $image = `toolButton -q -image1 $item`;
- scrollField -e -enable false -clear $scrFld;
- textFieldGrp -e -enable true $tfg2;
- text -e -l "Cannot edit tool button contents." $statTxt;
- break;
- case "shelfButton":
- $overlayLabel = `shelfButton -q -iol $item`;
- textFieldGrp -e -tx $overlayLabel $tfg3;
- $repeatFlag = `shelfButton -q -ecr $item`;
- checkBoxGrp -edit -value1 $repeatFlag $cbg;
-
- $image = `shelfButton -q -image1 $item`;
- $cmdStr = `shelfButton -q -c $item`;
- scrollField -e -enable true -text $cmdStr $scrFld;
- textFieldGrp -e -enable true $tfg2;
- text -e -l "Edit the shelf button command. Press keypad Enter to Save." $statTxt;
- break;
- }
- picture -e -image $image $pictCntl;
- textFieldGrp -e -enable true $tfg3;
- button -e -enable true $modBtn;
- button -e -enable true $upBtn;
- button -e -enable true $downBtn;
- button -e -enable true $delBtn;
- checkBoxGrp -e -enable true $cbg;
-
- if (`window -exists pickPixMapWin`) {
- xpmShelfItemChanged $image $item;
- }
- } else {
- // no items or nothing selected
- //
- picture -e -image "" $pictCntl;
- scrollField -e -enable false -clear $scrFld;
- textFieldGrp -e -enable false -text "" $tfg2;
- textFieldGrp -e -enable false $tfg3;
- button -e -enable false $modBtn;
- button -e -enable false $upBtn;
- button -e -enable false $downBtn;
- button -e -enable false $delBtn;
- checkBoxGrp -e -enable false $cbg;
- text -e -l "No item selected." $statTxt;
-
- if (`window -exists pickPixMapWin`) {
- string $empty = "";
- xpmShelfItemChanged $empty $empty;
- }
- }
- }
-
- global proc shelfEdCmdStringChanged()
- //
- // Description:
- // Callback for change in a command button's cmd string.
- //
- {
- global string $gShelfTopLevel;
-
- string $shelfList;
- string $itemList;
- string $scrFld;
- if(`about -mac`){
- $shelfList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tsl2";
- $scrFld = "shelfEditorWin|shelfEditorWin|fl|topTab|fl4|frm|scrFld";
- }else{
- $shelfList = "shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|fl|topTab|fl3|tsl2";
- $scrFld = "shelfEditorWin|fl|topTab|fl4|frm|scrFld";
- }
- string $selected[];
- string $childs[];
- int $selItems[];
- string $item;
-
- $selItems = `textScrollList -q -sii $itemList`;
- $selected = `textScrollList -q -si $shelfList`;
- $childs = `shelfLayout -q -ca ($gShelfTopLevel + "|" + $selected[0])`;
-
- if ($selItems[0] <= size($childs)) {
- $item = ($gShelfTopLevel + "|" + $selected[0] + "|"
- + $childs[($selItems[0]-1)]);
- shelfButton -e -c `scrollField -q -text $scrFld` $item;
- }
- }
-
- global proc shelfEdNewShelf()
- //
- // Description:
- // Add a new empty shelf tab.
- //
- {
- string $shelfList;
- if(`about -mac`){
- $shelfList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tsl";
- }else{
- $shelfList = "shelfEditorWin|fl|topTab|fl2|tsl";
- }
- int $index;
-
- addNewShelfTab "";
- updateShelfEdView;
-
- $index = `textScrollList -q -numberOfItems $shelfList`;
- textScrollList -e -sii $index $shelfList;
- shelfEdShelfChanged;
- }
-
- global proc shelfEdDeleteShelf()
- //
- // Description:
- // Deletes the selected shelf tab.
- //
- {
- string $shelfList;
- if(`about -mac`){
- $shelfList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tsl";
- }else{
- $shelfList = "shelfEditorWin|fl|topTab|fl2|tsl";
- }
- string $shelfName[] = `textScrollList -q -si $shelfList`;
- int $indexArr[];
- int $index = 0;
- int $nItems = 0;
-
- $indexArr = `textScrollList -q -sii $shelfList`;
- if (`deleteShelfTab $shelfName[0]`) {
- updateShelfEdView;
-
- $index = $indexArr[0];
- $nItems = `textScrollList -q -ni $shelfList`;
- if ($nItems > 0) {
- if ($nItems < $index) {
- $index = $nItems;
- }
- textScrollList -e -sii $index $shelfList;
- }
- shelfEdShelfChanged;
- }
- }
-
- global proc shelfEdItemNameChanged() {
-
- global string $gShelfTopLevel;
-
- string $shelfList;
- string $itemList;
- string $tfg2;
- if(`about -mac`){
- $shelfList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tsl2";
- $tfg2 = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tfg2";
- }else{
- $shelfList = "shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|fl|topTab|fl3|tsl2";
- $tfg2 = "shelfEditorWin|fl|topTab|fl3|tfg2";
- }
- string $item;
- string $itemStr;
- string $retVal[];
- string $selected[];
- string $type;
- int $index;
- int $itemIndex[];
- int $i, $nArr;
- int $isOkay = true;
- string $newName;
- string $oldName;
-
- $retVal = `textScrollList -q -si $itemList`;
- if (size($retVal) > 0) {
- $itemStr = $retVal[0];
- // get new name
- //
- $newName = `textFieldGrp -q -tx $tfg2`;
- $oldName = $retVal[0];
-
- // test for zero length name
- //
- if (size($newName) == 0) {
- $isOkay = false;
- confirmDialog -title "Alert"
- -button "OK"
- -defaultButton "OK"
- -message " Invalid item name. Please select another. "
- -parent shelfEditorWin;
-
- textFieldGrp -e -tx $oldName $tfg2;
- } else {
- // get real item name
- //
- $itemIndex = `textScrollList -q -sii $itemList`;
- $index = $itemIndex[0] - 1;
- $selected = `textScrollList -q -si $shelfList`;
- $retVal = `shelfLayout -q -ca $selected[0]`;
- $item = ($gShelfTopLevel + "|" + $selected[0] + "|" + $retVal[$index]);
- $type = `objectType $item`;
-
- switch ($type) {
- case "toolButton":
- if (catch(`renameUI $itemStr $newName`)) {
- //
- // error due to non - unique name for context
- //
- confirmDialog -title "Alert"
- -button "OK"
- -defaultButton "OK"
- -message " Context name is not unique. Please select another "
- -parent shelfEditorWin;
-
- $isOkay = false;
- }
- break;
- case "shelfButton":
- shelfButton -e -l $newName $item;
- break;
- }
-
- if ($isOkay) {
- shelfEdShelfChanged;
- textScrollList -e -sii $itemIndex[0] $itemList;
- shelfEdItemChanged;
- }
- }
- }
- }
-
-
- global proc shelfEdOverlayNameChanged() {
-
- global string $gShelfTopLevel;
-
- string $shelfList;
- string $itemList;
- string $tfg2;
- string $tfg3;
- if(`about -mac`){
- $shelfList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tsl2";
- $tfg2 = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tfg2";
- $tfg3 = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tfg3";
- }else{
- $shelfList = "shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|fl|topTab|fl3|tsl2";
- $tfg2 = "shelfEditorWin|fl|topTab|fl3|tfg2";
- $tfg3 = "shelfEditorWin|fl|topTab|fl3|tfg3";
- }
- string $item;
- string $itemStr;
- string $retVal[];
- string $selected[];
- string $type;
- int $index;
- int $itemIndex[];
- int $i, $nArr;
- int $isOkay = true;
- string $newName;
-
- $retVal = `textScrollList -q -si $itemList`;
- if (size($retVal) > 0) {
- $itemStr = $retVal[0];
- // get new name
- //
- $newName = `textFieldGrp -q -tx $tfg3`;
-
- // test for bad characters
- //
- string $regex = "[^0-9a-zA-Z_-\ ]";
- string $match = match( $regex, $newName );
- if ($match != "") {
- $isOkay = false;
- confirmDialog -title "Alert"
- -button "OK"
- -defaultButton "OK"
- -message " Item name contains illegal characters. Please select another. "
- -parent shelfEditorWin;
- } else {
- // get real item name
- //
- $itemIndex = `textScrollList -q -sii $itemList`;
- $index = $itemIndex[0] - 1;
- $selected = `textScrollList -q -si $shelfList`;
- $retVal = `shelfLayout -q -ca $selected[0]`;
- $item = ($gShelfTopLevel + "|" + $selected[0] + "|" + $retVal[$index]);
- $type = `objectType $item`;
-
- switch ($type) {
- case "toolButton":
- toolButton -e -iol $newName $item;
- break;
- case "shelfButton":
- shelfButton -e -iol $newName $item;
- break;
- }
-
- if ($isOkay) {
- shelfEdShelfChanged;
- textScrollList -e -sii $itemIndex[0] $itemList;
- shelfEdItemChanged;
- }
- }
- }
- }
-
-
-
- global proc shelfEdDeleteItem()
- {
- global string $gShelfTopLevel;
-
- string $shelfList;
- string $itemList;
- string $tfg2;
- string $pictCntl;
- string $scrFld;
- if(`about -mac`){
- $shelfList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tsl2";
- $tfg2 = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tfg2";
- $pictCntl = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|pictCntl";
- $scrFld = "shelfEditorWin|shelfEditorWin|fl|topTab|fl4|frm|scrFld";
- }else{
- $shelfList = "shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|fl|topTab|fl3|tsl2";
- $tfg2 = "shelfEditorWin|fl|topTab|fl3|tfg2";
- $pictCntl = "shelfEditorWin|fl|topTab|fl3|pictCntl";
- $scrFld = "shelfEditorWin|fl|topTab|fl4|frm|scrFld";
- }
- string $selected[];
- string $retVal[];
- string $item;
- string $type;
- string $ctx[];
- int $itemIndex[];
- int $index;
- int $nItems;
- int $i, $nArr;
-
- // update item text field
- //
- $retVal = `textScrollList -q -si $itemList`;
- if (size($retVal) > 0) {
- // get real item name
- //
- $itemIndex = `textScrollList -q -sii $itemList`;
- $index = $itemIndex[0] - 1;
- $selected = `textScrollList -q -si $shelfList`;
- $retVal = `shelfLayout -q -ca $selected[0]`;
- $item = ($gShelfTopLevel + "|" + $selected[0] + "|" + $retVal[$index]);
- $type = `objectType $item`;
-
- if ($type == "toolButton") {
- $ctx = `toolButton -q -toolArray $item`;
- $nArr = size($ctx);
- for ($i = 0; $i < $nArr; $i++) {
- deleteUI -toolContext $ctx[$i];
- }
- }
- deleteUI -control $item;
-
- shelfEdShelfChanged;
-
- $nItems = `textScrollList -q -ni $itemList`;
- if ($itemIndex[0] < $nItems) {
- textScrollList -e -sii $itemIndex[0] $itemList;
- } else if ($nItems > 0) {
- textScrollList -e -sii $nItems $itemList;
- }
- shelfEdItemChanged;
- }
- }
-
- global proc shelfEdModifyIcon() {
-
-
- global string $gShelfTopLevel;
-
- string $shelfList;
- string $itemList;
- string $tfg2;
- string $scrFld;
- if(`about -mac`){
- $shelfList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tsl2";
- $tfg2 = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tfg2";
- $scrFld = "shelfEditorWin|shelfEditorWin|fl|topTab|fl4|frm|scrFld";
- }else{
- $shelfList = "shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|fl|topTab|fl3|tsl2";
- $tfg2 = "shelfEditorWin|fl|topTab|fl3|tfg2";
- $scrFld = "shelfEditorWin|fl|topTab|fl4|frm|scrFld";
- }
- string $item;
- string $image;
- string $selected[];
- string $retVal[];
- string $type;
- int $itemIndex[];
- int $index;
- int $i;
-
- $retVal = `textScrollList -q -si $itemList`;
- if (size($retVal) > 0) {
- textFieldGrp -e -tx $retVal[0] $tfg2;
-
- // get real item name
- //
- $itemIndex = `textScrollList -q -sii $itemList`;
- $index = $itemIndex[0] - 1;
- $selected = `textScrollList -q -si $shelfList`;
- $retVal = `shelfLayout -q -ca $selected[0]`;
- $item = ($gShelfTopLevel + "|" + $selected[0] + "|" + $retVal[$index]);
- $type = `objectType $item`;
-
- switch ($type) {
- case "toolButton":
- $image = `toolButton -q -image1 $item`;
- break;
- case "shelfButton":
- $image = `shelfButton -q -image1 $item`;
- break;
- }
-
- if (`about -nt`) {
- pickXPMWin32 $image "shelfEditorWin";
- } else {
- if( `about -mac`)
- {
- string $newName;
- int $fileTest;
- string $dirName = getenv("MAYA_LOCATION");
- $dirName = dirname($dirName);
- $dirName = dirname($dirName) + "/extras/icons";
- $dirName = $dirName+"/*.xpm";
- $newName = `fileDialog -dm $dirName`;
- if ($newName == "") return; // cancel hit
- $fileTest = `filetest -s $newName`;
- if($fileTest == 0) {
- $newName = "";
- error("Invalid icon file\n");
- return;
- }
- shelfEdButtonImageChanged $newName;
- } else { //Unix family
- pickXPM $image $item;
- }
- }
- } else {
- // no items or nothing selected
- //
- }
- }
-
- global proc shelfEdButtonImageChanged (string $newXpmFile) {
-
-
- global string $gShelfTopLevel;
-
- string $shelfList;
- string $itemList;
- string $tfg2;
- string $pictCntl;
- string $scrFld;
- if(`about -mac`){
- $shelfList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tsl2";
- $tfg2 = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tfg2";
- $pictCntl = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|pictCntl";
- $scrFld = "shelfEditorWin|shelfEditorWin|fl|topTab|fl4|frm|scrFld";
- }else{
- $shelfList = "shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|fl|topTab|fl3|tsl2";
- $tfg2 = "shelfEditorWin|fl|topTab|fl3|tfg2";
- $pictCntl = "shelfEditorWin|fl|topTab|fl3|pictCntl";
- $scrFld = "shelfEditorWin|fl|topTab|fl4|frm|scrFld";
- }
- string $item;
- string $image;
- string $selected[];
- string $retVal[];
- string $type;
- int $itemIndex[];
- int $index;
- int $i;
-
- $retVal = `textScrollList -q -si $itemList`;
- if (size($retVal) > 0) {
- textFieldGrp -e -tx $retVal[0] $tfg2;
-
- // get real item name
- //
- $itemIndex = `textScrollList -q -sii $itemList`;
- $index = $itemIndex[0] - 1;
- $selected = `textScrollList -q -si $shelfList`;
- $retVal = `shelfLayout -q -ca $selected[0]`;
- $item = ($gShelfTopLevel + "|" + $selected[0] + "|" + $retVal[$index]);
- $type = `objectType $item`;
-
- switch ($type) {
- case "toolButton":
- toolButton -e -image1 $newXpmFile $item;
- break;
- case "shelfButton":
- shelfButton -e -image1 $newXpmFile $item;
- break;
- }
- picture -e -image $newXpmFile $pictCntl;
- } else {
- // no items or nothing selected
- //
- }
-
- }
-
- global proc shelfEdMoveShelf( int $isLeft ) {
-
- global string $gShelfTopLevel;
-
- string $shelfList;
- if(`about -mac`){
- $shelfList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tsl";
- }else{
- $shelfList = "shelfEditorWin|fl|topTab|fl2|tsl";
- }
- int $indexArr[];
- int $from, $to;
- int $move = false;
-
- $indexArr = `textScrollList -q -sii $shelfList`;
- $from = $indexArr[0];
-
- if ($isLeft) {
- if ($from > 1) {
- $to = $indexArr[0]-1;
- $move = true;
- }
- } else {
- if ($from < `tabLayout -q -nch $gShelfTopLevel`) {
- $to = $indexArr[0]+1;
- $move = true;
- }
- }
-
- if ($move) {
- int $load;
- string $name, $file;
-
- tabLayout -e -moveTab $from $to $gShelfTopLevel;
-
- $load = `optionVar -q ("shelfLoad" + $from)`;
- $name = `optionVar -q ("shelfName" + $from)`;
- $file = `optionVar -q ("shelfFile" + $from)`;
-
- optionVar
- -iv ("shelfLoad" + $from) `optionVar -q ("shelfLoad" + $to)`
- -sv ("shelfName" + $from) `optionVar -q ("shelfName" + $to)`
- -sv ("shelfFile" + $from) `optionVar -q ("shelfFile" + $to)`;
-
- optionVar
- -iv ("shelfLoad" + $to) $load
- -sv ("shelfName" + $to) $name
- -sv ("shelfFile" + $to) $file;
-
- updateShelfEdView;
- textScrollList -e -sii $to $shelfList;
- }
-
- }
-
- global proc shelfEdMoveItem( int $isLeft ) {
-
- global string $gShelfTopLevel;
-
- string $shelfList;
- string $itemList;
- if(`about -mac`){
- $shelfList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tsl2";
- }else{
- $shelfList = "shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|fl|topTab|fl3|tsl2";
- }
- string $selected[];
- string $retVal[];
- int $indexArr[];
- int $from, $to;
- int $move = false;
-
- $selected = `textScrollList -q -si $shelfList`;
- $itemIndex = `textScrollList -q -sii $itemList`;
- $retVal = `shelfLayout -q -ca ($gShelfTopLevel + "|" + $selected[0])`;
- $from = $itemIndex[0];
-
- if ($isLeft) {
- if ($from > 1) {
- $to = $itemIndex[0]-1;
- $move = true;
- }
- } else {
- if ($from < `shelfLayout -q -nch $selected`) {
- $to = $itemIndex[0]+1;
- $move = true;
- }
- }
-
- if ($move) {
- int $nArr;
- string $type;
-
- //
- // move the item
- //
- shelfLayout -e -position $retVal[$from-1] $to
- ($gShelfTopLevel + "|" + $selected[0]);
-
- //
- // update the item list
- //
- textScrollList -e -removeAll $itemList;
- $retVal = `shelfLayout -q -ca ($gShelfTopLevel + "|" + $selected[0])`;
- $nArr = size($retVal);
- for ($i = 0; $i < $nArr; $i++) {
- $type = `objectType $retVal[$i]`;
- switch ($type) {
- case "toolButton":
- $name = `toolButton -q -tool $retVal[$i]`;
- break;
- case "shelfButton":
- $name = `shelfButton -q -label $retVal[$i]`;
- if ($name == "") {
- $name = " ";
- }
- break;
- }
- textScrollList -e -a $name $itemList;
- }
- textScrollList -e -sii $to $itemList;
- }
-
- }
-
-
- global proc shelfEdTabPreSelect()
- //
- // Description:
- // This proc is called when a tab label is clicked on. Check if
- // the contents of the command button have been modified and
- // if so offer a chance to save.
- //
- {
- shelfEdCheckForCommandChange;
- }
-
- global proc shelfEdSaveAllShelves()
- //
- // Description:
- // The Save All Shelves button has been pressed.
- //
- {
- global string $gShelfTopLevel;
- string $topTab;
- if(`about -mac`){
- $topTab = "shelfEditorWin|shelfEditorWin|fl|topTab";
- }else{
- $topTab = "shelfEditorWin|fl|topTab";
- }
-
- if (`tabLayout -q -sti $topTab` == 3) {
- //
- // Leaving the edit commands tab. Check if the contents have
- // changed and offer a chance to save.
- //
- shelfEdCheckForCommandChange;
- }
-
- saveAllShelves $gShelfTopLevel;
- window -e -visible false shelfEditorWin;
- }
-
- global proc shelfEdCloseWindow()
- //
- // Description:
- // The Close button has been pressed.
- //
- {
- string $topTab;
-
- if(`about -mac`){
- $topTab = "shelfEditorWin|shelfEditorWin|fl|topTab";
- }else{
- $topTab = "shelfEditorWin|fl|topTab";
- }
-
- if (`tabLayout -q -sti $topTab` == 3) {
- //
- // Leaving the edit commands tab. Check if the contents have
- // changed and offer a chance to save.
- //
- shelfEdCheckForCommandChange;
- }
-
- window -e -visible false shelfEditorWin;
- }
-
- global proc shelfEdCheckForCommandChange()
- //
- // Description:
- // Check if the contents of the command button have been modified and
- // if so offer a chance to save.
- //
- {
- global string $gShelfTopLevel;
-
- string $shelfList;
- string $itemList;
- string $scrFld;
- if(`about -mac`){
- $shelfList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|shelfEditorWin|fl|topTab|fl3|tsl2";
- $scrFld = "shelfEditorWin|shelfEditorWin|fl|topTab|fl4|frm|scrFld";
- }else{
- $shelfList = "shelfEditorWin|fl|topTab|fl2|tsl";
- $itemList = "shelfEditorWin|fl|topTab|fl3|tsl2";
- $scrFld = "shelfEditorWin|fl|topTab|fl4|frm|scrFld";
- }
- string $selected[];
- string $childs[];
- int $selItems[];
- string $item;
- string $itemCmd;
- string $scrFieldText;
-
- if (!`textScrollList -exists $itemList`) return;
-
- $selItems = `textScrollList -q -sii $itemList`;
- $selected = `textScrollList -q -si $shelfList`;
- $childs = `shelfLayout -q -ca ($gShelfTopLevel + "|" + $selected[0])`;
-
- if (size($selItems) > 0 && $selItems[0] <= size($childs)) {
- $item = ($gShelfTopLevel + "|" + $selected[0] + "|"
- + $childs[($selItems[0]-1)]);
- $itemCmd = `shelfButton -q -c $item`;
- $scrFieldText = `scrollField -q -text $scrFld`;
- if ($itemCmd != $scrFieldText) {
- string $okStr = "Save Changes";
- string $cancelStr = "Discard Changes";
- $msg = ("Contents of the shelf button have changed. Do you want to save the changes?");
- if ($okStr == `confirmDialog -parent shelfEditorWin -title "Confirm"
- -message $msg
- -button $okStr -button $cancelStr -defaultButton $okStr
- -cancelButton $cancelStr -dismissString $cancelStr`)
- {
- shelfButton -e -c $scrFieldText $item;
- }
- scrollField -e -text `shelfButton -q -c $item` $scrFld;
- }
- }
- }
-